<template>
	<view class="beijingse">
		<!-- 头部个人信息 -->
		<view class="toubuxx">
			<image class="wdbjt" src="../../static/image/system/wdbjt.png" mode=""></image>
			<view class="flexleft toubunr" @click="tologin">
				<view class="shilitu margin_right3">
					<image :src="headimg" mode=""></image>
				</view>
				<view class="bigtext">{{name?name:'用户'}}</view>
			</view>
		</view>
		<view class="mainpadding neirong">
			<view class="zhye radius" @click="tzye">
				<view class="flexbetween">
					<view class="">
						<view class="baisetext">账户余额 (元)</view>
						<view class="margin_top bbaisetext">￥{{yue}}</view>
					</view>
					<view class="lookbtn">查看</view>
				</view>
			</view>
			<view class="ffffff radius mainpadding flexbetween margin_top" @click="tzwddd">
				<view class="flexleft">
					<view class="wddd margin_right2">
						<image src="../../static/image/system/wddd.png" mode=""></image>
					</view>
					<view class="titletext">我的订单</view>
				</view>
				<view class="righticon"></view>
			</view>
			<view class="ffffff radius mainpadding  margin_top">
				<view class="flexbetween xiahuaxian" @click="tzwdtd">
					<view class="flexleft">
						<view class="wddd margin_right2">
							<image src="../../static/image/system/wdtd.png" mode=""></image>
						</view>
						<view class="titletext">我的团队</view>
					</view>
					<view class="righticon"></view>
				</view>
				<view class="flexbetween xiahuaxian margin_top" @click="tzyqhy">
					<view class="flexleft">
						<view class="wddd margin_right2">
							<image src="../../static/image/system/yqhy.png" mode=""></image>
						</view>
						<view class="titletext">邀请好友</view>
					</view>
					<view class="righticon"></view>
				</view>
				<view class="flexbetween xiahuaxian margin_top" @click="tzcwhhr">
					<view class="flexleft">
						<view class="wddd margin_right2">
							<image src="../../static/image/system/cwhhr.png" mode=""></image>
						</view>
						<view class="titletext">成为合伙人</view>
					</view>
					<view class="righticon"></view>
				</view>
				<view class="flexbetween xiahuaxian margin_top" @click="tzzszq">
					<view class="flexleft">
						<view class="wddd margin_right2">
							<image src="../../static/image/system/zszq.png" mode=""></image>
						</view>
						<view class="titletext">知识专区</view>
					</view>
					<view class="righticon"></view>
				</view>
				<view class="flexbetween margin_top" @click="tzsz">
					<view class="flexleft">
						<view class="wddd margin_right2">
							<image src="../../static/image/system/shezhi.png" mode=""></image>
						</view>
						<view class="titletext">设置</view>
					</view>
					<view class="righticon"></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				headimg: '',
				username: '',
				yue: '',
			}
		},
		onShow() {
			this.getuserinfo();
		},
		methods: {
			// 跳转邀请好友
			tzyqhy() {
				uni.navigateTo({
					url: '/pages/mypage/yqhy'
				})
			},
			// 跳转成为合伙人
			tzcwhhr() {
				uni.navigateTo({
					url: '/pages/mypage/chengweihhr'
				})
			},
			getuserinfo(){
				let _this = this;
				httpRequest.request('api/user/index', 'POST', {}).then(res => {
					_this.headimg = res.data.avatar_text;
					_this.username = res.data.nickname;
					_this.yue = res.data.money_text;
				})
			},
			tologin() {
				if (!httpRequest.checkIsLogin()) {
					uni.navigateTo({
						url:'/pages/login/login'
					})
				}
			},
			// 跳转设置
			tzsz() {
				uni.navigateTo({
					url: '/pages/mypage/shezhi'
				})
			},
			// 跳转我的团队
			tzwdtd() {
				uni.navigateTo({
					url: '/pages/mypage/wodetuand'
				})
			},
			// 跳转知识专区
			tzzszq() {
				uni.navigateTo({
					url: '/pages/mypage/zhishizq'
				})
			},
			// 跳转我的订单
			tzwddd() {
				uni.navigateTo({
					url: '/pages/mypage/wodedingdan'
				})
			},
			// 跳转余额页面
			tzye() {
				uni.navigateTo({
					url: '/pages/mypage/yue'
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	.toubunr {
		position: absolute;
		top: 140rpx;
		left: 30rpx;
	}

	.wdbjt {
		height: 457rpx;
		width: 100%;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.beijingse {
		min-height: calc(100vh - 140rpx) !important;
		// min-height: 0;
		// max-height: calc(100vh - 170rpx);
	}

	.dianhua {
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
	}


	.eshiliu {
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
	}

	.erwm {
		width: 243rpx;
		height: 243rpx;
		margin: 30rpx auto 0;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.neijianju {
		padding: 0 130rpx;
	}

	.tkbox {
		padding-bottom: 60rpx;
	}

	// .tanktb {
	// 	width: 100%;
	// 	height: 237rpx;
	// 	background-size: 100% 100%;
	// 	background-image: url('../../static/image/system/tktb.png');
	// }
</style>
<style lang="scss" scoped>
	.neirong {
		position: relative;
		top: -185rpx;
	}

	.xiahuaxian {
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(0, 0, 0, 0.02);
	}

	.wddd {
		width: 38rpx;
		height: 38rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.lookbtn {
		width: 120rpx;
		height: 48rpx;
		border-radius: 66rpx;
		background-color: #fff;
		font-size: 28rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #EF8933;
	}

	.bbaisetext {
		font-size: 60rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: #FFFFFF;
	}

	.baisetext {
		font-size: 28rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #FFFFFF;
	}

	.zhye {
		width: 100%;
		box-sizing: border-box;
		background-size: 100% 100%;
		padding: 40rpx 62rpx;
		background-color: #fa6c3c;
	}

	.youjt {
		width: 16rpx;
		height: 28rpx;
		z-index: 10;

		image {
			width: 16rpx;
			height: 28rpx;
		}
	}

	.huangtext {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #EF8933;
	}

	.line {
		width: 2rpx;
		height: 20rpx;
		background-color: #EF8933;
		border-radius: 48rpx;
	}

	.shilitu {
		width: 122rpx;
		height: 122rpx;
		border-radius: 50%;

		image {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
	}

	.toubuxx {
		position: relative;
	}
</style>
